1. Field of the Invention
The invention relates to camera devices, and more particularly to image processing of camera devices.
2. Description of the Related Art
A Direct Show program is an application programming interface produced by Microsoft for software developers to perform various operations with media files or streams. A Windows system developer can use the Direct Show program to play or record media files. Ordinarily, a Direct Show program is often used to receive video data generated by a camera and show the video data on a screen coupled to a host. In addition, the Direct Show program is also a component program of a Windows Media Player for playing multi-media files.
A host executing a Direct Show program receives video data of a variety of formats from a camera. Ordinarily, a camera device can output video data of a YUV format or a motion joint photographic experts group (MJPG) format. According to the YUV format, a pixel of an image is divided into a luma component and two chroma components. The YUV format is further divided into Y′UV, YUV, YCbCr, YPbPr, and YUY2 formats, the difference between which is the numbers of luma components and chroma components for representing a pixel. According to the MJPG format, pixels of an image are compressed and encoded to reduce the data amount of the image. The host must therefore decode image data of the MJPG format before the host shows the image data of the MJPG format.
When the host shows the image data with the MJPG format on a screen, the luminance and chrominance of the image data shown on the screen differ from those of an image of a YUY2 format. A screen generally can only receive image data with a RGB format. A host therefore must convert image data to the RGB format before the image data is shown on the screen. The Direct Show program provided by Microsoft, however, converts image data of a YUY2 format and an MJPG format to image data of a RGB format with different transform coefficients, leading to difference of luminance and chrominance of the image data converted from the YUY2 format and the MJPG format. To make image data converted from the YUY2 format and the MJPG format have the same luminance and chrominance, a camera device capable of adjusting the luminance and chrominance of output image data is therefore required.